<?php $role_access = Zend_Registry::get('role_access'); 


?><!DOCTYPE html>
<html>
    <head>
        <?php //echo $this->headTitle(); ?>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <!-- bootstrap -->
        <link href="<?php echo $this->CSS_PATH; ?>bootstrap/bootstrap.css" rel="stylesheet" />
        <link href="<?php echo $this->CSS_PATH; ?>bootstrap/bootstrap-responsive.css" rel="stylesheet" />
        <link href="<?php echo $this->CSS_PATH; ?>bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

        <link href="<?php echo $this->CSS_PATH; ?>compiled/personal-info.css" type="text/css" rel="stylesheet" />

        <!-- libraries -->
        <link href="<?php echo $this->CSS_PATH; ?>lib/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo $this->CSS_PATH; ?>lib/font-awesome.css" type="text/css" rel="stylesheet" />
        <link href="<?php echo $this->CSS_PATH; ?>lib/bootstrap.datepicker.css" type="text/css" rel="stylesheet" />
        <link href="<?php echo $this->CSS_PATH; ?>lib/select2.css" type="text/css" rel="stylesheet" />
        <!-- global styles -->
        <link rel="stylesheet" type="text/css" href="<?php echo $this->CSS_PATH; ?>compiled/layout.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo $this->CSS_PATH; ?>compiled/elements.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo $this->CSS_PATH; ?>compiled/icons.css" />


        <!-- this page specific styles -->
        <link rel="stylesheet" href="<?php echo $this->CSS_PATH; ?>compiled/index.css" type="text/css" media="screen" />    
        <!--add New css-->
        <link rel="stylesheet" type="text/css" href="<?php echo $this->CSS_PATH; ?>developer.css" />

        <!-- open sans font -->
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css' />

        <!-- lato font -->
        <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,900,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css' />

        <!--[if lt IE 9]>
          <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        
        
        
        <title>Service App</title>
        <?php
        echo $this->headLink();
        ?>
        <script>
            var BASE_PATH = '<?php echo BASE_PATH; ?>';
            var SITE_URL = '<?php echo $this->BASE_URL . ""; ?>';
        </script>

    </head>
    <body>

        <!-- navbar -->
        <div class="navbar navbar-inverse">
            <div class="navbar-inner">
                <button type="button" class="btn btn-navbar visible-phone" id="menu-toggler">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <?php
                        if($this->user->lgn_type==1):
                           $link=$this->url(array('module' => 'default', 'controller' => 'admin', 'action' => 'editprofile'), null, TRUE);
                           $logolink=$this->url(array('module' => 'default', 'controller' => 'admin', 'action' => 'dashboard'), null, TRUE);
                        endif;
                        
                         if($this->user->lgn_type==2):
                            $link=$this->url(array('module' => 'default', 'controller' => 'contractor', 'action' => 'editprofile'), null, TRUE);
                            $logolink=$this->url(array('module' => 'default', 'controller' => 'contractor', 'action' => 'dashboard'), null, TRUE);
                         endif;
                        
                         if($this->user->lgn_type==3):
                            $link=$this->url(array('module' => 'default', 'controller' => 'customer', 'action' => 'editprofile'), null, TRUE);
                            $logolink=$this->url(array('module' => 'default', 'controller' => 'customer', 'action' => 'dashboard'), null, TRUE);

                         endif;
                        ?>
                <a class="brand" href="<?php echo $logolink; ?>">
                   <?php 
                    if($this->LOGO_NAME != ''):
                    if(file_exists($this->UPLOAD_PATH."logo/".$this->LOGO_NAME)):?>
                    <img src="<?php echo $this->LOGO;?>" height="25px" width="160px" /> 
                    <?php 
                    else:
                        echo 'SERVICE-APP';
                    endif;
                    else:
                        echo 'SERVICE-APP';
                    endif;
?></a>

                <ul class="nav pull-right">                
                    <li class="dropdown">
                    <a href="#" class="dropdown-toggle hidden-phone" data-toggle="dropdown">
                        <?php echo $this->translate("my_account"); ?>
                        <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        
                        <li>
                            <a href="<?php echo $link?>"> 
                                <?php echo $this->translate("edit_profile"); ?>
                            </a>
                            <?php /*if($this->user->lgn_type==2):?>
                                 <a href="#country_data" data-toggle ="modal"> 
                                     <?php echo $this->translate("change_company"); ?>
                                 </a>
                            <?php endif;*/?>
                        </li>
                        
                    </ul>
                </li>
                    <li class="settings hidden-phone">
                        <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'logout', 'action' => 'index'), null, TRUE); ?>" role="button">

                            <i class="icon-share-alt"></i>
                        </a>
                    </li>
                </ul>            
            </div>
        </div>
        <!-- end navbar -->

        <!-- sidebar -->
        <div id="sidebar-nav">
            <ul id="dashboard-menu">
                <!--<li <?php if ($this->CONTROLLER_NAME == 'index' && $this->ACTION_NAME == 'index'): ?> class="active" <?php endif; ?>>
                <?php if ($this->CONTROLLER_NAME == 'index' && $this->ACTION_NAME == 'index'): ?> 
                            <div class="pointer">
                                <div class="arrow"></div>
                                <div class="arrow_border"></div>
                            </div>
                <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'index', 'action' => 'index'), null, TRUE); ?>">
                        <i class="icon-cog"></i>
                        <span>Dashboard</span>
                    </a>
                </li>            
                -->	
                   <!-- Company MENU-----> 
                   <?php if (array_key_exists('company', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'company' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                   <?php if ($this->CONTROLLER_NAME == 'company' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                   <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'company', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-home"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'company', 'action' => 'list'), null, TRUE); ?>'"><?php echo $this->translate("company_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" <?php if ($this->CONTROLLER_NAME == 'company' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                        <?php if (array_key_exists('list', $role_access['company'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'company' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?> href="<?php echo $this->url(array('module' => 'default', 'controller' => 'company', 'action' => 'list'), null, TRUE); ?>"><?php echo $this->translate("company_list_menu"); ?></a></li>
                        <?php endif;?>
                        <?php if (array_key_exists('form', $role_access['company'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'company' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'company', 'action' => 'form'), null, TRUE); ?>"><?php echo $this->translate("company_frm_menu"); ?></a></li>
                        <?php endif;?>
                    </ul>
                </li>
                <?php endif;?>
                <!-- Contractor MENU-----> 
                <?php if (array_key_exists('contractor', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'contractor' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'contractor' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'contractor', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-user"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'contractor', 'action' => 'list'), null, TRUE); ?>'"><?php echo $this->translate("contractor_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" 
                        <?php if ($this->CONTROLLER_NAME == 'contractor' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                        <?php if (array_key_exists('list', $role_access['contractor'])): ?>
                            <li><a <?php if ($this->CONTROLLER_NAME == 'contractor' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?> href="<?php echo $this->url(array('module' => 'default', 'controller' => 'contractor', 'action' => 'list'), null, TRUE); ?>"><?php echo $this->translate("contractor_list_menu"); ?></a></li>
                        <?php endif;?>
                        <?php if (array_key_exists('form', $role_access['contractor'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'contractor' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'contractor', 'action' => 'form'), null, TRUE); ?>"><?php echo $this->translate("contractor_frm_menu"); ?></a></li>
                        <?php endif;?>
                        
                                                
                    </ul>
                </li>
                 <?php endif;?>
                 <!-- Customer MENU-----> 
                <?php if (array_key_exists('customer', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'customer' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'customer' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'customer', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-user"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'customer', 'action' => 'list'), null, TRUE); ?>'"><?php echo $this->translate("customer_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" 
                        <?php if ($this->CONTROLLER_NAME == 'customer' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                        <?php if (array_key_exists('list', $role_access['customer'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'customer' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?> href="<?php echo $this->url(array('module' => 'default', 'controller' => 'customer', 'action' => 'list'), null, TRUE); ?>"><?php echo $this->translate("customer_list_menu"); ?></a></li>
                        <?php endif;?>
                        <?php if (array_key_exists('form', $role_access['customer'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'customer' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'customer', 'action' => 'form'), null, TRUE); ?>"><?php echo $this->translate("customer_frm_menu"); ?></a></li>
                    <?php endif;?>
                    </ul>
                </li>
                <?php endif;?>
                
                 <!-- Admin MENU-----> 
                 <?php if (array_key_exists('admin', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'admin' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'admin' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'admin', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-user"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'admin', 'action' => 'list'), null, TRUE); ?>'"><?php echo $this->translate("admin_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" 
                        <?php if ($this->CONTROLLER_NAME == 'admin' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                        <?php if (array_key_exists('list', $role_access['admin'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'admin' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?> href="<?php echo $this->url(array('module' => 'default', 'controller' => 'admin', 'action' => 'list'), null, TRUE); ?>"><?php echo $this->translate("admin_list_menu"); ?></a></li>
                        <?php endif;?>
                        <?php if (array_key_exists('form', $role_access['admin'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'admin' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'admin', 'action' => 'form'), null, TRUE); ?>"><?php echo $this->translate("admin_frm_menu"); ?></a></li>
                        <?php endif;?>
                    </ul>
                </li>
                <?php endif;?>
                <!-- SITE MENU--->
                <?php if (array_key_exists('site', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'site' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'site' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'site', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-globe"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'site', 'action' => 'list'), null, TRUE); ?>'">
                            <?php echo $this->translate("site_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" 
                        <?php if ($this->CONTROLLER_NAME == 'site' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                        <?php if (array_key_exists('list', $role_access['site'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'site' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?> href="<?php echo $this->url(array('module' => 'default', 'controller' => 'site', 'action' => 'list'), null, TRUE); ?>">
                                <?php echo $this->translate("site_list_menu"); ?>
                            </a>
                        </li>
                        <?php endif;?>
                        <?php if (array_key_exists('form', $role_access['site'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'site' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'site', 'action' => 'form'), null, TRUE); ?>">
                                <?php echo $this->translate("site_frm_menu"); ?>
                            </a>
                        </li>
                        <?php endif;?>
                    </ul>
                </li>
                <?php endif;?>
                <!-- building MENU-----> 
                <?php if (array_key_exists('building', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'building' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'building' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'building', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-reorder"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'building', 'action' => 'list'), null, TRUE); ?>'">
                            <?php echo $this->translate("building_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" 
                        <?php if ($this->CONTROLLER_NAME == 'building' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                        <?php if (array_key_exists('list', $role_access['building'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'building' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?> href="<?php echo $this->url(array('module' => 'default', 'controller' => 'building', 'action' => 'list'), null, TRUE); ?>">
                                <?php echo $this->translate("building_list_menu"); ?>
                            </a>
                        </li>
                        <?php endif;?>
                        <?php if (array_key_exists('form', $role_access['building'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'building' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'building', 'action' => 'form'), null, TRUE); ?>">
                                <?php echo $this->translate("building_frm_menu"); ?>
                            </a>
                        </li>
                        <?php endif;?>
                    </ul>
                </li>
                <?php endif;?>
                <!-- department MENU-----> 
                 <?php if (array_key_exists('department', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'department' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'department' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'department', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-sitemap"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'department', 'action' => 'list'), null, TRUE); ?>'">
                            <?php echo $this->translate("department_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" 
                        <?php if ($this->CONTROLLER_NAME == 'department' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                        <?php if (array_key_exists('list', $role_access['department'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'department' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?> href="<?php echo $this->url(array('module' => 'default', 'controller' => 'department', 'action' => 'list'), null, TRUE); ?>">
                                <?php echo $this->translate("department_list_menu"); ?>
                            </a>
                        </li>
                        <?php endif;?>
                        <?php if (array_key_exists('form', $role_access['department'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'department' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'department', 'action' => 'form'), null, TRUE); ?>">
                                <?php echo $this->translate("department_frm_menu"); ?>
                            </a>
                        </li>
                        <?php endif;?>
                    </ul>
                </li>
                <?php endif;?>
                <!-- hardware MENU-----> 
                <?php if (array_key_exists('hardware', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'hardware' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'hardware' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'hardware', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-wrench"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'hardware', 'action' => 'list'), null, TRUE); ?>'">
                            <?php echo $this->translate("hardware_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" 
                        <?php if ($this->CONTROLLER_NAME == 'hardware' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                        <?php if (array_key_exists('form', $role_access['hardware'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'hardware' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?> href="<?php echo $this->url(array('module' => 'default', 'controller' => 'hardware', 'action' => 'list'), null, TRUE); ?>">
                                <?php echo $this->translate("hardware_list_menu"); ?>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if (array_key_exists('form', $role_access['hardware'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'hardware' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'hardware', 'action' => 'form'), null, TRUE); ?>">
                                <?php echo $this->translate("hardware_frm_menu"); ?>
                            </a>
                        </li>
                        <?php endif; ?>
                    </ul>
                </li>
                <?php endif; ?>
                
                
                <!-- Subject MENU-----> 
                 <?php if (array_key_exists('subject', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'subject' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'subject' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'subject', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-book"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'subject', 'action' => 'list'), null, TRUE); ?>'">
                            <?php echo $this->translate("subject_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" 
                        <?php if ($this->CONTROLLER_NAME == 'subject' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                         <?php if (array_key_exists('list', $role_access['subject'])): ?>
                         <li><a <?php if ($this->CONTROLLER_NAME == 'subject' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?> href="<?php echo $this->url(array('module' => 'default', 'controller' => 'subject', 'action' => 'list'), null, TRUE); ?>">
                                <?php echo $this->translate("subject_list_menu"); ?>
                            </a>
                        </li>
                        <?php endif; ?>
                         <?php if (array_key_exists('form', $role_access['subject'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'subject' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'subject', 'action' => 'form'), null, TRUE); ?>">
                                <?php echo $this->translate("subject_frm_menu"); ?>
                            </a>
                        </li>
                        <?php endif; ?>
                    </ul>
                </li>
                <?php endif; ?>
                
                <!-- Request MENU-----> 
                 <?php if (array_key_exists('request', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'request' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'request' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'request', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-edit"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'request', 'action' => 'list'), null, TRUE); ?>'">
                            <?php echo $this->translate("request_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" 
                        <?php if ($this->CONTROLLER_NAME == 'request' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                        <?php if (array_key_exists('list', $role_access['request'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'request' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?> href="<?php echo $this->url(array('module' => 'default', 'controller' => 'request', 'action' => 'list'), null, TRUE); ?>">
                                <?php echo $this->translate("request_list_menu"); ?>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if (array_key_exists('form', $role_access['request'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'request' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'request', 'action' => 'form'), null, TRUE); ?>">
                                <?php echo $this->translate("request_frm_menu"); ?>
                            </a>
                        </li>
                        <?php endif; ?>
                    </ul>
                </li>
                <?php endif; ?>
                
                <!-- Dropdown Type MENU-----> 
                <?php if (array_key_exists('type', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'type' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'type' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form')): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'type', 'action' => 'list'), null, TRUE); ?>" class="dropdown-toggle">
                        <i class="icon-plus"></i>
                        <span onclick="window.location = '<?php echo $this->url(array('module' => 'default', 'controller' => 'type', 'action' => 'list'), null, TRUE); ?>'"><?php echo $this->translate("list_type_menu"); ?></span>
                        <i class="icon-chevron-down"></i>
                    </a>
                    <ul class="submenu" 
                        <?php if ($this->CONTROLLER_NAME == 'type' && ($this->ACTION_NAME == 'list' || $this->ACTION_NAME == 'form' || $this->ACTION_NAME == 'view')): ?> style="display: block;"<?php else: ?>style="display: none;" <?php endif; ?>>
                        <?php if (array_key_exists('list', $role_access['type'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'type' && $this->ACTION_NAME == 'list'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'type', 'action' => 'list'), null, TRUE); ?>"><?php echo $this->translate("listing_type_menu"); ?></a></li>
                        <?php endif;?>
                        <?php if (array_key_exists('form', $role_access['type'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'type' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'type', 'action' => 'form'), null, TRUE); ?>"><?php echo $this->translate("list_type_frm_menu"); ?></a></li>
                        <?php endif;?>
                        <?php if (array_key_exists('english form', $role_access['type'])): ?>
                        <li><a <?php if ($this->CONTROLLER_NAME == 'type' && $this->ACTION_NAME == 'englishform'): ?> class="active" <?php endif; ?>href="<?php echo $this->url(array('module' => 'default', 'controller' => 'type', 'action' => 'englishform'), null, TRUE); ?>"><?php echo $this->translate("list_type_englishfrm_menu"); ?></a></li>
                        <?php endif;?>
                    </ul>
                </li>
                <?php endif;?>
                <!-- Role MENU-----> 
                <?php 
                if($this->user->roletype!='Contractor' && $this->user->roletype!='Customer'):
                if (array_key_exists('role', $role_access)): ?>
                <li <?php if ($this->CONTROLLER_NAME == 'role' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'role' && $this->ACTION_NAME == 'form'): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                     
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'role', 'action' => 'form'), null, TRUE); ?>">
                        <i class="icon-group"></i>
                        <span><?php echo $this->translate("role_menu"); ?></span>
                    </a>
                </li>	
                <?php endif; 
 endif;?>
                <!-- Preferences MENU-----> 
                <?php if (array_key_exists('preferences', $role_access)): ?>
                 <li <?php if ($this->CONTROLLER_NAME == 'preferences' && $this->ACTION_NAME == 'form'): ?> class="active" <?php endif; ?>>
                    <?php if ($this->CONTROLLER_NAME == 'preferences' && $this->ACTION_NAME == 'form'): ?> 
                        <div class="pointer">
                            <div class="arrow"></div>
                            <div class="arrow_border"></div>
                        </div>
                    <?php endif; ?>
                     
                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'preferences', 'action' => 'form'), null, TRUE); ?>">
                        <i class="icon-cogs"></i>
                        <span><?php echo $this->translate("site_preferences"); ?></span>
                    </a>
                </li>	
                <?php endif; ?>
                
                <!-- Logout MENU-----> 
                <li>

                    <a href="<?php echo $this->url(array('module' => 'default', 'controller' => 'logout', 'action' => 'index'), null, TRUE); ?>">
                        <i class="icon-unlock"></i>
                        <span><?php echo $this->translate("logout_menu"); ?></span>
                    </a>
                </li>				




            </ul>
        </div>
        <!-- end sidebar -->

        <!-- main container -->
        <div class="content">
            <?php echo $this->layout()->content; ?>
        </div>

        <!-- scripts -->

        <script src="<?php echo $this->JS_PATH; ?>jquery-1.10.2.js"></script>
        <script src="<?php echo $this->JS_PATH; ?>bootstrap.min.js"></script>
        <script src="<?php echo $this->JS_PATH; ?>jquery-ui-1.10.2.custom.min.js"></script>
        <script src="<?php echo $this->JS_PATH; ?>theme.js"></script>
        <script src="<?php echo $this->JS_PATH; ?>project.js"></script>
        <script src="<?php echo $this->JS_PATH; ?>select2.min.js"></script>
       

        <?php
        echo $this->headScript();
        ?>

 
<?php  

if(count($this->companyData) == 1){
    foreach($this->companyData as $key => $value){
       $company_id= $value['id'];
       $authData = Zend_Auth::getInstance()->getIdentity();
       $authData->COMPANY_SESSION_ID = $company_id;
       header('location:dashboard');
        //exit;
    }
}

if($this->user->COMPANY_SESSION_ID):
    $session_company_id = $this->user->COMPANY_SESSION_ID;
else:
    $session_company_id = "";
endif;


if($this->user->lgn_type==2):?>
<script src="<?php echo $this->JS_PATH; ?>contractor_company.js"></script>
<?php //endif;
endif;?>
<input type="hidden" name="company_session_id" id="company_session_id" value="<?php echo $session_company_id?>">
<!--popup-->

    <div class="modal fade" id="country_data" tabindex="-1" role="dialog">
        <div id="contractorcompany-listing"></div><div class="modal-dialog">
          <div class="modal-content">
            <div class="modal-header">
               
                <h4 class="modal-title"><?php echo $this->translate("company_header"); ?> List </h4>
            
            </div>
            <div class="modal-body">
                <form class="form-horizontal" id="session_company" method="post" role="form" action="<?php echo $this->url(array('controller' => 'contractor', 'action' => 'setcountry'), null, true); ?>">
                   
                    <div class="alert alert-error display-none" id="com_error">
                        <div class="text-left">
                            <i class="icon-remove-sign"></i>
                             Please select company
                        </div>
                    </div>
                    
                    
                    <div class="form-group">
                        <label for="input1" class="col-lg-2 control-label"><?php echo $this->translate("company_header"); ?> :</label>
                        <div class="col-lg-10">
                            &nbsp; 
                            <div class="ui-select">
                            <select  name="company_name" id="company_name" >
                                <option value="">Select Company</option>
                                <?php foreach($this->companyData as $key =>$value):?>
                                <?php if(isset($this->user->COMPANY_SESSION_ID)):
                                        if($this->user->COMPANY_SESSION_ID == $value['id']):
                                            $selected = "selected";
                                        else:
                                            $selected = "";
                                        endif;
                                    else:
                                        $selected = "";
                                    endif;
                                ?>
                                
                                <option <?php echo $selected;?> value="<?php echo $value['id'];?>"><?php echo $value['name'];?></option>
                                <?php endforeach;?>
                            </select>
                            </div>
                        </div>
                    </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-primary" id="company_id">Save changes</button>
            </div>
              </form>
          </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
  </div>

   </body>
</html>